/*
 * $Id: vpn.h,v 1.4 2006-03-09 04:16:22 bacon Exp $
 */


#ifndef _XP_MSW_VPN_H_
#define _XP_MSW_VPN_H_

#include <xp/types.h>
#include <xp/macros.h>

typedef struct xp_vpn_t xp_vpn_t;

struct xp_vpn_t
{
	xp_char_t* name;
	void* handle;
	xp_bool_t __dynamic;
};

enum
{
	XP_VPN_NETWORK_LOGON              = (1 << 0),
	XP_VPN_USE_LOGON_CREDENTIALS      = (1 << 1),
	XP_VPN_SECURE_LOCAL_FILES         = (1 << 2),
	XP_VPN_SHOW_LOCAL_FILES           = (1 << 3),
	XP_VPN_SHOW_PROGRESS              = (1 << 4),
	XP_VPN_REMOTE_DEFAULT_GATEWAY     = (1 << 5),
	XP_VPN_REQUIRE_DATA_ENCRYPTION    = (1 << 6),
	XP_VPN_REQUIRE_ENCRYPTED_PASSWORD = (1 << 7)
};

/* status code */
enum 
{
	XP_VPN_CONNECTING,
	XP_VPN_CONNECTED,
	XP_VPN_AUTHENTICATING,
	XP_VPN_AUTHENTICATED,
	XP_VPN_DISCONNECTED
};

#ifdef __cplusplus
extern "C" {
#endif

xp_vpn_t* xp_vpn_open (xp_vpn_t* vpn, const xp_char_t* name);
int xp_vpn_close (xp_vpn_t* vpn);

int xp_vpn_connect (xp_vpn_t* vpn, 
	const xp_char_t* server, const xp_char_t* username,
	const xp_char_t* password, const xp_char_t* domain);
int xp_vpn_disconnect (xp_vpn_t* vpn);
int xp_vpn_getstatus (xp_vpn_t* vpn, int* status);

int xp_createvpnentry (const xp_char_t* name, const xp_char_t* server, int opt);
int xp_removevpnentry (const xp_char_t* name);

#ifdef __cplusplus
}
#endif

#endif
